<?php
use Magento\Vault\Model\Ui\TokenUiComponentProviderInterface;
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
// @codingStandardsIgnoreFile

/** @var \Magento\Framework\View\Element\Template $block */
$details = $block->getData(TokenUiComponentProviderInterface::COMPONENT_DETAILS);
$icon = $block->getData('icons')[$details['type']];
$id = $block->escapeHtml($block->getData('id'));
?>
<div data-mage-init='{
        "Magento_Braintree/js/vault": {
            "container": "payment_<?php /* @noEscape */ echo $id; ?>",
            "publicHash": "<?php echo $block->escapeHtml($block->getData(TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH)); ?>",
            "code": "<?php echo $block->escapeHtml($block->getData('code')); ?>",
            "nonceUrl": "<?php echo $block->escapeUrl($block->getData('nonceUrl')); ?>"
        }
    }' id="payment_<?php /* @noEscape */ echo $id;?>" class="admin__field">
    <div class="admin__field-control control">
        <input type="radio" id="token_switcher_<?php /* @noEscape */ echo $id; ?>" name="payment[token_switcher]"/>
        <img src="<?php echo $block->escapeUrl($icon['url']); ?>"
             width="<?php echo $block->escapeHtml($icon['width']); ?>"
             height="<?php echo $block->escapeHtml($icon['height']); ?>"
             class="payment-icon" >
        <span><?php echo $block->escapeHtml(__('ending'));?></span>
        <span><?php echo $block->escapeHtml($details['maskedCC']); ?></span>
        (<span><?php echo $block->escapeHtml(__('expires'));?></span>:
        <span><?php echo $block->escapeHtml($details['expirationDate']); ?></span>)
    </div>
</div>
